<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@page pageEncoding="UTF-8"%>
<%@include file="../WEB-INF/jspf/controlesessao.jspf"%>
<c:catch var ="catchException">
    <c:if test="${empty paramValues.componente}">
        <p>Selecione pelo menos um componente!</p>
    </c:if>
   <c:forEach var='componente' items='${paramValues.componente}'>     
         <c:catch var ="catchException">
            <sql:update var="insertC" dataSource="jdbc/dbo_MicrosoftSQLServer">
                    insert into Componentes_Docentes(matricula,id_componente)
                    values(?,?)
                    <sql:param value="${param.matricula}"/>
                    <sql:param value="${componente}"/>
         </sql:update>
         </c:catch>

    </c:forEach>
    <c:if test="${!empty paramValues.componente}">
       <p>Registro Salvo!</p>
    </c:if>     
</c:catch>
